package com.company.cloud.web.service.impl;

import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.company.cloud.web.models.SitMapModel;
import com.company.cloud.web.service.WebArtService;
import com.company.cloud.web.service.WebIndexService;
import com.company.cloud.web.service.WebPrdService;
import com.company.cloud.web.utils.WebArtUtils;
import com.company.cloud.web.utils.WebPrdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class WebIndexServiceImpl implements WebIndexService {

    @Autowired
    private WebPrdService webPrdService;
    @Autowired
    private WebArtService webArtService;

    @Override
    public Map<String, Object> getPageIndexData() {
        Map<String, Object> data=new HashMap<>();
        JSONObject category= webPrdService.categoryTree();
        Object menu=webArtService.getParameter("header-menus");
        data.put("category",category);
        data.put("menu",menu);
        Object footer =webArtService.getParameter("footer-menus");
        data.put("footer",footer);
        Object friendLink =webArtService.getParameter("friendLink");
        data.put("friendLink",friendLink);

        Object copyright =webArtService.getParameter("copyright");
        data.put("copyright",copyright);


        Object homeActivity =webArtService.getParameter("home-activity");
        data.put("homeActivity",homeActivity);

        Object homeArtist =webArtService.getParameter("home-artist");
        data.put("homeArtist",homeArtist);

        Object homeProductSort =webArtService.getParameter("home-product-sort-1");
        data.put("homeProductSort",homeProductSort);


        Object homeProductCate =webArtService.getParameter("home-product-cate-1");
        data.put("homeProductCate",homeProductCate);



        Object homeService = webArtService.getParameter("home-product-service");
        data.put("homeService",homeService);

        Object homeServiceen = webArtService.getParameter("home-product-service-en");
        data.put("homeServiceen",homeServiceen);

        Object homeBanner =webArtService.getParameter("home-banner");
        data.put("homeBanner",homeBanner);

        Object homeBanneren =webArtService.getParameter("home-banner-en");
        data.put("homeBanneren",homeBanneren);

        Object exBanner = webArtService.getParameter("ex-banner");
        data.put("exBanner",exBanner);


        Object exSchedule = webArtService.getParameter("ex-schedule");
        data.put("exSchedule",exSchedule);


        Object exScheduleen = webArtService.getParameter("ex-schedule-en");
        data.put("exScheduleen",exScheduleen);


        Object exMedia = webArtService.getParameter("ex-media1");
        data.put("exMedia",exMedia);

        Object exMedia1 = webArtService.getParameter("ex-media2");
        data.put("exMedia1",exMedia1);

        Object exFile = webArtService.getParameter("ex-file");
        data.put("exFile",exFile);

        Object exOlineBanner = webArtService.getParameter("exonline-banner");
        data.put("exOlineBanner",exOlineBanner);

        Object exOlineIndex = webArtService.getParameter("exonline-index");
        data.put("exOlineIndex",exOlineIndex);

        Object exCompanyBanner = webArtService.getParameter("ex-company-banner");
        data.put("exCompanyBanner",exCompanyBanner);

        Object exArtistBanner = webArtService.getParameter("ex-artist-banner");
        data.put("exArtistBanner",exArtistBanner);


        Object homeProudct1 = webArtService.getParameter("home-product-p-1");
        data.put("homeProudct1",homeProudct1);

        Object homeProudct2 = webArtService.getParameter("home-product-p-2");
        data.put("homeProudct2",homeProudct2);

        Object homeProudct3 = webArtService.getParameter("home-product-p-3");
        data.put("homeProudct3",homeProudct3);

        Object homeProudct4 = webArtService.getParameter("home-product-p-4");
        data.put("homeProudct4",homeProudct4);

        Object homeProudct5 = webArtService.getParameter("home-product-p-5");
        data.put("homeProudct5",homeProudct5);

        Object homeProudct6 = webArtService.getParameter("home-product-p-6");
        data.put("homeProudct6",homeProudct6);

        Object homeProudct7 = webArtService.getParameter("home-product-p-7");
        data.put("homeProudct7",homeProudct7);

        Object homeProudct8 = webArtService.getParameter("home-product-p-8");
        data.put("homeProudct8",homeProudct8);

        Object homeProudct9 = webArtService.getParameter("home-product-p-9");
        data.put("homeProudct9",homeProudct9);


        return data;







    }

    @Override
    public  Map<String,List<SitMapModel>> getSitMap(String path) {
        return WebPrdUtils.getSitMap(path);
    }

}
